
import {  HostConfig } from '@coremail/mail_base'

export type AccountConfig = {
  email: string;
  pass: string;
  smtp: HostConfig;
  pop3: HostConfig;
  imap: HostConfig;
}

const config163 = {
  smtp: {
    host: 'smtp.126.com',
    port: 25,
    secure: false,
  },
  pop3: {
    host: 'pop.126.com',
    port: 110,
    secure: false,
  },
  imap: {
    host: 'imap.163.com',
    // port: 993,
    port: 143,
    secure: false,
  },
};
const config139 = {
  smtp: {
    host: 'smtp.139.com',
    // port: 25,
    // secure: false,
    port: 465,
    secure: true,
  },
  pop3: {
    host: 'pop.139.com',
    // port: 110,
    // secure: false,
    port: 995,
    secure: true,
  },
  imap: {
    host: 'imap.139.com',
    // port: 143,
    // secure: false,
    port: 993,
    secure: true,
  },
};
const configSina = {
  smtp: {
    host: 'smtp.sina.com',
    port: 25,
    secure: false,
  },
  pop3: {
    host: 'pop.sina.com',
    port: 110,
    secure: false,
  },
  imap: {
    host: 'imap.sina.com',
    port: 143,
    secure: false,
  },
};
const configSinaCn = {
  smtp: {
    host: 'smtp.sina.cn',
    // port: 25,
    // secure: false,
    port: 465,
    secure: true,
  },
  pop3: {
    host: 'pop.sina.cn',
    port: 110,
    secure: false,
  },
  imap: {
    host: 'imap.sina.cn',
    // port: 143,
    // secure: false,
    port: 993,
    secure: true,
  },
};
const configAliyun = {
  smtp: {
    host: 'smtp.aliyun.com',
    port: 25,
    secure: false,
  },
  pop3: {
    host: 'pop3.aliyun.com',
    port: 110,
    secure: false,
  },
  imap: {
    host: 'imap.aliyun.com',
    port: 143,
    secure: false,
  },
};
const configQQ = {
  smtp: {
    host: 'smtp.qq.com',
    port: 25,
    secure: false,
  },
  pop3: {
    host: 'pop.qq.com',
    port: 110,
    secure: false,
  },
  imap: {
    host: 'imap.qq.com',
    port: 143,
    secure: false,
  },
};
const configXyz = {
  smtp: {
    host: '172.16.11.253',
    port: 25,
    secure: false,
  },
  pop3: {
    host: '172.16.11.253',
    port: 110,
    secure: false,
  },
  imap: {
    host: '172.16.11.253',
    port: 143,
    secure: false,
  },
};
const config608 = {
  smtp: {
    host: '172.16.10.48',
    port: 25,
    secure: false,
  },
  pop3: {
    host: '172.16.10.48',
    port: 110,
    secure: false,
  },
  imap: {
    host: '172.16.10.48',
    port: 143,
    secure: false,
  },
};
const configOutlook = {
  smtp: {
    host: 'outlook.office365.com',
    port: 25,
    secure: true,
  },
  pop3: {
    host: 'outlook.office365.com',
    port: 995,
    secure: true,
  },
  imap: {
    host: 'outlook.office365.com',
    port: 993,
    secure: true,
  },
};
const configTom = {
  smtp: {
    host: 'smtp.tom.com',
    port: 25,
    secure: false,
  },
  pop3: {
    host: 'pop3.tom.com',
    port: 995,
    secure: true,
  },
  imap: {
    host: 'imap.tom.com',
    port: 143,
    secure: false,
    // port: 993,
    // secure: true,
  },
};
const configYeah = {
  smtp: {
    host: 'smtp.yeah.net',
    port: 25,
    secure: true,
  },
  pop3: {
    host: 'pop3.yeah.net',
    port: 995,
    secure: true,
  },
  imap: {
    host: 'imap.yeah.net',
    port: 143,
    secure: false,
    // port: 993,
    // secure: true,
  },
};

export const configList: AccountConfig[] = [
  {
    email: 'hmdemo1028@aliyun.com',
    pass: 'password123,./',
    ...configAliyun
  },
  {
    email: 'hmtest1028@tom.com',
    pass: 'password123,./',
    ...configTom
  },
   {
     email: `hmtest1028@126.com`,
     pass: 'LIAIKYLSOPXLQDKR',
     ...config163
  },
  {
    email: `hmtest1028@yeah.net`,
    pass: 'KWKKQVNQIIZFKLTP',
    ...configYeah
  },
];


export const storage = new LocalStorage({
  accounts: configList.map(c => c.email),
  currentAccount: configList[0]
});
